import request from '@/hooks/request.ts'

const Api = {
  register: '/login/register', // 注册
  resetPassword: '/login/resetPassword', // 重置密码
  sendRegSms: '/login/sendRegSms', // 获取验证码
  login: '/login/login',
  getUserInfo: '/platform/user/userInfo',
  batchAddDefaultVerbalTrick: '/verbalTrick/batchAddDefaultVerbalTrick',
  SystemSetting: 'platform/user/editUserSetting',
  getUserSetting: '/platform/user/getUserSetting',
}

export const sendRegSms = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.sendRegSms,
    data: parameter,
  })
}

export const register = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.register,
    data: parameter,
  })
}

export const login = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.login,
    data: parameter,
  })
}

export const getUserInfo = () => {
  return request({
    method: 'get',
    url: Api.getUserInfo,
  })
}

export const resetPassword = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.resetPassword,
    data: parameter,
  })
}

export const batchAddDefaultVerbalTrick = () => {
  return request({
    method: 'post',
    url: Api.batchAddDefaultVerbalTrick,
  })
}

export const settingUserSystem = (data: any) => {
  return request({
    method: 'post',
    url: Api.SystemSetting,
    data,
  })
}

export const getUserSetting = () => {
  return request({
    method: 'post',
    url: Api.getUserSetting,
  })
}
